<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="myform" name="myform">
<p>
    新闻分类:<select id="name" name="name">
                <option value="0" selected>全部</option>
                <option value="1">国际</option>
                <option value="2">国内</option>
                <option value="3">军事</option>
            </select>
    新闻标题:<input type="text" id="title" name="title">
            <input type="button" id="jquerybtn" name="jquerybtn" value="查询">
</p>
</form>
<table  id="mytable" border="1">
    <caption></caption>
    <thead>
    <tr>
        <th colspan="6">新闻列表</th>
    </tr>
    <tr>
        <th>新闻编号</th>
        <th>新闻标题</th>
        <th>新闻摘要</th>
        <th>作者</th>
        <th>创建时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody></tbody>
    <tfoot></tfoot>
</table>
<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
    $(function(){
        //页面加载时，查询默认第一页
        showData();
        //点击查询
        $("#jquerybtn").click(function(){
            showData();
        });
        function showData(){
            $.get("queue.do",$("#myform").serialize(),function(data){
                for(var i=0;i<data.length;i++){
                    var news = data[i];
                    var str="<tr>"
                        +"<td>"+news.newsId+"</td>"
                        +"<td>"+news.title+"</td>"
                        +"<td>"+news.summary+"</td>"
                        +"<td>"+news.author+"</td>"
                        +"<td><a href=\"updateNews.html?newsId="+news.newsId+"\">修改.</a></td>"
                        +"</tr>";
                    $("#mytable>tbody").append(str);
                };
            },"json");
        };
    });
</script>


</body>
</html>